// source --> http://elenaschwarz.com/wp-content/plugins/jetpack/modules/related-posts/related-posts.js?ver=20150408 /* jshint onevar: false */ /* globals related_posts_js_options */ /** * Load related posts */ (function($) { var jprp = { response: null, /** * Utility get related posts JSON endpoint from URLs * * @param string URL (optional) * @return string endpoint URL */ getEndpointURL: function( URL ) { var locationObject = document.location; if ( 'string' === typeof( URL ) && URL.match( /^https?:\/\// ) ) { locationObject = document.createElement( 'a' ); locationObject.href = URL; } var args = 'relatedposts=1'; if ( $( '#jp-relatedposts' ).data( 'exclude' ) ) { args += '&relatedposts_exclude=' + $( '#jp-relatedposts' ).data( 'exclude' ); } var pathname = locationObject.pathname; if ( '/' !== pathname[0] ) { pathname = '/' + pathname; } if ( '' === locationObject.search ) { return pathname + '?' + args; } else { return pathname + locationObject.search + '&' + args; } }, getAnchor: function( post, classNames ) { var anchor_title = post.title; if ( '' !== ( '' + post.excerpt ) ) { anchor_title += '\n\n' + post.excerpt; } var anchor = $( '' ); anchor.attr({ 'class': classNames, 'href': post.url, 'title': anchor_title, 'rel': post.rel, 'data-origin': post.url_meta.origin, 'data-position': post.url_meta.position }); var anchor_html = $( '
' ).append( anchor ).html(); return [ anchor_html.substring( 0, anchor_html.length-4 ), '' ]; }, generateMinimalHtml: function( posts ) { var self = this; var html = ''; $.each( posts, function( index, post ) { var anchor = self.getAnchor( post, 'jp-relatedposts-post-a' ); var classes = 'jp-relatedposts-post jp-relatedposts-post' + index; if ( post.classes.length > 0 ) { classes += ' ' + post.classes.join( ' ' ); } html += '

'; html += ''; html += ''; html += ''; html += '

'; } ); return ''; }, generateVisualHtml: function( posts ) { var self = this; var html = ''; $.each( posts, function( index, post ) { var anchor = self.getAnchor( post, 'jp-relatedposts-post-a' ); var classes = 'jp-relatedposts-post jp-relatedposts-post' + index; if ( post.classes.length > 0 ) { classes += ' ' + post.classes.join( ' ' ); } if ( ! post.img.src ) { classes += ' jp-relatedposts-post-nothumbs'; } else { classes += ' jp-relatedposts-post-thumbs'; } html += '
'; if ( post.img.src ) { html += anchor[0] + '' + anchor[1]; } else { var anchor_overlay = self.getAnchor( post, 'jp-relatedposts-post-a jp-relatedposts-post-aoverlay' ); html += anchor_overlay[0] + anchor_overlay[1]; } html += '<' + related_posts_js_options.post_heading + ' class="jp-relatedposts-post-title">' + anchor[0] + post.title + anchor[1] + ''; html += '

' ).text( post.excerpt ).html() + '

'; html += ''; html += ''; html += '
'; } ); return ''; }, /** * We want to set a max height on the excerpt however we want to set * this according to the natual pacing of the page as we never want to * cut off a line of text in the middle so we need to do some detective * work. */ setVisualExcerptHeights: function() { var elements = $( '#jp-relatedposts .jp-relatedposts-post-nothumbs .jp-relatedposts-post-excerpt' ); if ( 0 >= elements.length ) { return; } var fontSize = parseInt( elements.first().css( 'font-size' ), 10 ), lineHeight = parseInt( elements.first().css( 'line-height' ), 10 ); // Show 5 lines of text elements.css( 'max-height', ( 5 * lineHeight / fontSize ) + 'em' ); }, getTrackedUrl: function( anchor ) { var args = 'relatedposts_hit=1'; args += '&relatedposts_origin=' + $( anchor ).data( 'origin' ); args += '&relatedposts_position=' + $( anchor ).data( 'position' ); var pathname = anchor.pathname; if ( '/' !== pathname[0] ) { pathname = '/' + pathname; } if ( '' === anchor.search ) { return pathname + '?' + args; } else { return pathname + anchor.search + '&' + args; } }, cleanupTrackedUrl: function() { if ( 'function' !== typeof history.replaceState ) { return; } var cleaned_search = document.location.search.replace( /\brelatedposts_[a-z]+=[0-9]*&?\b/gi, '' ); if ( '?' === cleaned_search ) { cleaned_search = ''; } if ( document.location.search !== cleaned_search ) { history.replaceState( {}, document.title, document.location.pathname + cleaned_search ); } } }; $( function() { jprp.cleanupTrackedUrl(); $.getJSON( jprp.getEndpointURL(), function( response ) { if ( 0 === response.items.length || 0 === $( '#jp-relatedposts' ).length ) { return; } jprp.response = response; var html = ''; if ( !response.show_thumbnails ) { html = jprp.generateMinimalHtml( response.items ); } else { html = jprp.generateVisualHtml( response.items ); } $( '#jp-relatedposts' ).append( html ); jprp.setVisualExcerptHeights(); $( '#jp-relatedposts' ).show(); $( '#jp-relatedposts a.jp-relatedposts-post-a' ).click(function() { this.href = jprp.getTrackedUrl( this ); }); } ); } ); })(jQuery); // source --> http://elenaschwarz.com/wp-content/plugins/wp-responsive-menu/js/jquery.transit.min.js?ver=4.7.28 /*! * jQuery Transit - CSS3 transitions and transformations * (c) 2011-2012 Rico Sta. Cruz * MIT Licensed. * * http://ricostacruz.com/jquery.transit * http://github.com/rstacruz/jquery.transit */ (function(k){k.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:true,useTransitionEnd:false};var d=document.createElement("div");var q={};function b(v){if(v in d.style){return v}var u=["Moz","Webkit","O","ms"];var r=v.charAt(0).toUpperCase()+v.substr(1);if(v in d.style){return v}for(var t=0;t-1;q.transition=b("transition");q.transitionDelay=b("transitionDelay");q.transform=b("transform");q.transformOrigin=b("transformOrigin");q.transform3d=e();var i={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"};var f=q.transitionEnd=i[q.transition]||null;for(var p in q){if(q.hasOwnProperty(p)&&typeof k.support[p]==="undefined"){k.support[p]=q[p]}}d=null;k.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};k.cssHooks["transit:transform"]={get:function(r){return k(r).data("transform")||new j()},set:function(s,r){var t=r;if(!(t instanceof j)){t=new j(t)}if(q.transform==="WebkitTransform"&&!a){s.style[q.transform]=t.toString(true)}else{s.style[q.transform]=t.toString()}k(s).data("transform",t)}};k.cssHooks.transform={set:k.cssHooks["transit:transform"].set};if(k.fn.jquery<"1.8"){k.cssHooks.transformOrigin={get:function(r){return r.style[q.transformOrigin]},set:function(r,s){r.style[q.transformOrigin]=s}};k.cssHooks.transition={get:function(r){return r.style[q.transition]},set:function(r,s){r.style[q.transition]=s}}}n("scale");n("translate");n("rotate");n("rotateX");n("rotateY");n("rotate3d");n("perspective");n("skewX");n("skewY");n("x",true);n("y",true);function j(r){if(typeof r==="string"){this.parse(r)}return this}j.prototype={setFromString:function(t,s){var r=(typeof s==="string")?s.split(","):(s.constructor===Array)?s:[s];r.unshift(t);j.prototype.set.apply(this,r)},set:function(s){var r=Array.prototype.slice.apply(arguments,[1]);if(this.setter[s]){this.setter[s].apply(this,r)}else{this[s]=r.join(",")}},get:function(r){if(this.getter[r]){return this.getter[r].apply(this)}else{return this[r]||0}},setter:{rotate:function(r){this.rotate=o(r,"deg")},rotateX:function(r){this.rotateX=o(r,"deg")},rotateY:function(r){this.rotateY=o(r,"deg")},scale:function(r,s){if(s===undefined){s=r}this.scale=r+","+s},skewX:function(r){this.skewX=o(r,"deg")},skewY:function(r){this.skewY=o(r,"deg")},perspective:function(r){this.perspective=o(r,"px")},x:function(r){this.set("translate",r,null)},y:function(r){this.set("translate",null,r)},translate:function(r,s){if(this._translateX===undefined){this._translateX=0}if(this._translateY===undefined){this._translateY=0}if(r!==null&&r!==undefined){this._translateX=o(r,"px")}if(s!==null&&s!==undefined){this._translateY=o(s,"px")}this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var r=(this.scale||"1,1").split(",");if(r[0]){r[0]=parseFloat(r[0])}if(r[1]){r[1]=parseFloat(r[1])}return(r[0]===r[1])?r[0]:r},rotate3d:function(){var t=(this.rotate3d||"0,0,0,0deg").split(",");for(var r=0;r<=3;++r){if(t[r]){t[r]=parseFloat(t[r])}}if(t[3]){t[3]=o(t[3],"deg")}return t}},parse:function(s){var r=this;s.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(t,v,u){r.setFromString(v,u)})},toString:function(t){var s=[];for(var r in this){if(this.hasOwnProperty(r)){if((!q.transform3d)&&((r==="rotateX")||(r==="rotateY")||(r==="perspective")||(r==="transformOrigin"))){continue}if(r[0]!=="_"){if(t&&(r==="scale")){s.push(r+"3d("+this[r]+",1)")}else{if(t&&(r==="translate")){s.push(r+"3d("+this[r]+",0)")}else{s.push(r+"("+this[r]+")")}}}}}return s.join(" ")}};function m(s,r,t){if(r===true){s.queue(t)}else{if(r){s.queue(r,t)}else{t()}}}function h(s){var r=[];k.each(s,function(t){t=k.camelCase(t);t=k.transit.propertyMap[t]||k.cssProps[t]||t;t=c(t);if(k.inArray(t,r)===-1){r.push(t)}});return r}function g(s,v,x,r){var t=h(s);if(k.cssEase[x]){x=k.cssEase[x]}var w=""+l(v)+" "+x;if(parseInt(r,10)>0){w+=" "+l(r)}var u=[];k.each(t,function(z,y){u.push(y+" "+w)});return u.join(", ")}k.fn.transition=k.fn.transit=function(z,s,y,C){var D=this;var u=0;var w=true;if(typeof s==="function"){C=s;s=undefined}if(typeof y==="function"){C=y;y=undefined}if(typeof z.easing!=="undefined"){y=z.easing;delete z.easing}if(typeof z.duration!=="undefined"){s=z.duration;delete z.duration}if(typeof z.complete!=="undefined"){C=z.complete;delete z.complete}if(typeof z.queue!=="undefined"){w=z.queue;delete z.queue}if(typeof z.delay!=="undefined"){u=z.delay;delete z.delay}if(typeof s==="undefined"){s=k.fx.speeds._default}if(typeof y==="undefined"){y=k.cssEase._default}s=l(s);var E=g(z,s,y,u);var B=k.transit.enabled&&q.transition;var t=B?(parseInt(s,10)+parseInt(u,10)):0;if(t===0){var A=function(F){D.css(z);if(C){C.apply(D)}if(F){F()}};m(D,w,A);return D}var x={};var r=function(H){var G=false;var F=function(){if(G){D.unbind(f,F)}if(t>0){D.each(function(){this.style[q.transition]=(x[this]||null)})}if(typeof C==="function"){C.apply(D)}if(typeof H==="function"){H()}};if((t>0)&&(f)&&(k.transit.useTransitionEnd)){G=true;D.bind(f,F)}else{window.setTimeout(F,t)}D.each(function(){if(t>0){this.style[q.transition]=E}k(this).css(z)})};var v=function(F){this.offsetWidth;r(F)};m(D,w,v);return this};function n(s,r){if(!r){k.cssNumber[s]=true}k.transit.propertyMap[s]=q.transform;k.cssHooks[s]={get:function(v){var u=k(v).css("transit:transform");return u.get(s)},set:function(v,w){var u=k(v).css("transit:transform");u.setFromString(s,w);k(v).css({"transit:transform":u})}}}function c(r){return r.replace(/([A-Z])/g,function(s){return"-"+s.toLowerCase()})}function o(s,r){if((typeof s==="string")&&(!s.match(/^[\-0-9\.]+$/))){return s}else{return""+s+r}}function l(s){var r=s;if(k.fx.speeds[r]){r=k.fx.speeds[r]}return o(r,"ms")}k.transit.getTransitionValue=g})(jQuery); (function($){$.fn.touchwipe=function(settings){var config={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(settings)$.extend(config,settings);this.each(function(){var startX;var startY;var isMoving=false;function cancelTouch(){this.removeEventListener('touchmove',onTouchMove);startX=null;isMoving=false}function onTouchMove(e){if(config.preventDefaultEvents){e.preventDefault()}if(isMoving){var x=e.touches[0].pageX;var y=e.touches[0].pageY;var dx=startX-x;var dy=startY-y;if(Math.abs(dx)>=config.min_move_x){cancelTouch();if(dx>0){config.wipeLeft()}else{config.wipeRight()}}else if(Math.abs(dy)>=config.min_move_y){cancelTouch();if(dy>0){config.wipeDown()}else{config.wipeUp()}}}}function onTouchStart(e){if(e.touches.length==1){startX=e.touches[0].pageX;startY=e.touches[0].pageY;isMoving=true;this.addEventListener('touchmove',onTouchMove,false)}}if('ontouchstart'in document.documentElement){this.addEventListener('touchstart',onTouchStart,false)}});return this}})(jQuery); // source --> http://elenaschwarz.com/wp-content/plugins/wp-responsive-menu/js/jquery.sidr.js?ver=4.7.28 /* * Sidr * https://github.com/artberri/sidr * * Copyright (c) 2013 Alberto Varela * Licensed under the MIT license. */ ;(function( $ ){ var sidrMoving = false, sidrOpened = false; // Private methods var privateMethods = { // Check for valids urls // From : http://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-an-url isUrl: function (str) { var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name '((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path '(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string '(\\#[-a-z\\d_]*)?$','i'); // fragment locator if(!pattern.test(str)) { return false; } else { return true; } }, // Loads the content into the menu bar loadContent: function($menu, content) { $menu.html(content); }, // Add sidr prefixes addPrefix: function($element) { var elementId = $element.attr('id'), elementClass = $element.attr('class'); if(typeof elementId === 'string' && '' !== elementId) { $element.attr('id', elementId.replace(/([A-Za-z0-9_.\-]+)/g, 'sidr-id-$1')); } if(typeof elementClass === 'string' && '' !== elementClass && 'sidr-inner' !== elementClass) { $element.attr('class', elementClass.replace(/([A-Za-z0-9_.\-]+)/g, 'sidr-class-$1')); } $element.removeAttr('style'); }, execute: function(action, name, callback) { // Check arguments if(typeof name === 'function') { callback = name; name = 'sidr'; } else if(!name) { name = 'sidr'; } // Declaring var $menu = $('#' + name), $body = $($menu.data('body')), $html = $('html'), menuWidth = $menu.outerWidth(true), speed = $menu.data('speed'), side = $menu.data('side'), displace = $menu.data('displace'), onOpen = $menu.data('onOpen'), onClose = $menu.data('onClose'), bodyAnimation, menuAnimation, scrollTop, bodyClass = (name === 'sidr' ? 'sidr-open' : 'sidr-open ' + name + '-open'); // Open Sidr if('open' === action || ('toggle' === action && !$menu.is(':visible'))) { // Check if we can open it if( $menu.is(':visible') || sidrMoving ) { return; } // If another menu opened close first if(sidrOpened !== false) { methods.close(sidrOpened, function() { methods.open(name); }); return; } // Lock sidr sidrMoving = true; // Left or right? if(side === 'left') { bodyAnimation = {left: menuWidth + 'px'}; menuAnimation = {left: '0px'}; } else { bodyAnimation = {right: menuWidth + 'px'}; menuAnimation = {right: '0px'}; } // Prepare page if container is body if($body.is('body')){ scrollTop = $html.scrollTop(); $html.css('overflow-x', 'hidden').scrollTop(scrollTop); } // Open menu if(displace){ $body.addClass('sidr-animating').css({ width: $body.width(), position: 'absolute' }).animate(bodyAnimation, speed, function() { $(this).addClass(bodyClass); }); } else { setTimeout(function() { $(this).addClass(bodyClass); }, speed); } $menu.css('display', 'block').animate(menuAnimation, speed, function() { sidrMoving = false; sidrOpened = name; // Callback if(typeof callback === 'function') { callback(name); } $body.removeClass('sidr-animating'); }); // onOpen callback onOpen(); } // Close Sidr else { // Check if we can close it if( !$menu.is(':visible') || sidrMoving ) { return; } // Lock sidr sidrMoving = true; // Right or left menu? if(side === 'left') { bodyAnimation = {left: 0}; menuAnimation = {left: '-' + menuWidth + 'px'}; } else { bodyAnimation = {right: 0}; menuAnimation = {right: '-' + menuWidth + 'px'}; } // Close menu if($body.is('body')){ scrollTop = $html.scrollTop(); $html.removeAttr('style').scrollTop(scrollTop); } $body.addClass('sidr-animating').animate(bodyAnimation, speed).removeClass(bodyClass); $menu.animate(menuAnimation, speed, function() { $menu.removeAttr('style').hide(); $body.removeAttr('style'); $('html').removeAttr('style'); sidrMoving = false; sidrOpened = false; // Callback if(typeof callback === 'function') { callback(name); } $body.removeClass('sidr-animating'); }); // onClose callback onClose(); } } }; // Sidr public methods var methods = { open: function(name, callback) { privateMethods.execute('open', name, callback); }, close: function(name, callback) { privateMethods.execute('close', name, callback); }, toggle: function(name, callback) { privateMethods.execute('toggle', name, callback); }, // I made a typo, so I mantain this method to keep backward compatibilty with 1.1.1v and previous toogle: function(name, callback) { privateMethods.execute('toggle', name, callback); } }; $.sidr = function( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'function' || typeof method === 'string' || ! method ) { return methods.toggle.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.sidr' ); } }; $.fn.sidr = function( options ) { var settings = $.extend( { name : 'sidr', // Name for the 'sidr' speed : 200, // Accepts standard jQuery effects speeds (i.e. fast, normal or milliseconds) side : 'left', // Accepts 'left' or 'right' source : null, // Override the source of the content. renaming : true, // The ids and classes will be prepended with a prefix when loading existent content body : 'body', // Page container selector, displace: true, // Displace the body content or not onOpen : function() {}, // Callback when sidr opened onClose : function() {} // Callback when sidr closed }, options); var name = settings.name, $sideMenu = $('#' + name); // If the side menu do not exist create it if( $sideMenu.length === 0 ) { $sideMenu = $('
') .attr('id', name) .appendTo($('body')); } // Adding styles and options $sideMenu .addClass('sidr') .addClass(settings.side) .data({ speed : settings.speed, side : settings.side, body : settings.body, displace : settings.displace, onOpen : settings.onOpen, onClose : settings.onClose }); // The menu content if(typeof settings.source === 'function') { var newContent = settings.source(name); privateMethods.loadContent($sideMenu, newContent); } else if(typeof settings.source === 'string' && privateMethods.isUrl(settings.source)) { $.get(settings.source, function(data) { privateMethods.loadContent($sideMenu, data); }); } else if(typeof settings.source === 'string') { var htmlContent = '', selectors = settings.source.split(','); $.each(selectors, function(index, element) { htmlContent += '
' + $(element).html() + '
'; }); // Renaming ids and classes if(settings.renaming) { var $htmlContent = $('
').html(htmlContent); $htmlContent.find('*').each(function(index, element) { var $element = $(element); privateMethods.addPrefix($element); }); htmlContent = $htmlContent.html(); } privateMethods.loadContent($sideMenu, htmlContent); } else if(settings.source !== null) { $.error('Invalid Sidr Source'); } return this.each(function(){ var $this = $(this), data = $this.data('sidr'); // If the plugin hasn't been initialized yet if ( ! data ) { $this.data('sidr', name); if('ontouchstart' in document.documentElement) { $this.bind('touchstart', function(e) { var theEvent = e.originalEvent.touches[0]; this.touched = e.timeStamp; }); $this.bind('touchend', function(e) { var delta = Math.abs(e.timeStamp - this.touched); if(delta < 200) { e.preventDefault(); methods.toggle(name); } }); } else { $this.click(function(e) { e.preventDefault(); methods.toggle(name); }); } } }); }; })( jQuery );